//
//  ContactsSectionHeaderView.m
//  NuwaRobot
//
//  Created by Kendama on 2017/12/8.
//  Copyright © 2017年 Kendama. All rights reserved.
//

#import "ContactsSectionHeaderView.h"

@implementation ContactsSectionHeaderView

- (UIImageView *)iconImageView
{
    if(!_iconImageView)
    {
        UIView *superView = self;
        _iconImageView = [[UIImageView alloc]init];
        [superView addSubview:_iconImageView];
    }
    return _iconImageView;
}
- (UILabel *)nameLabel
{
    if(!_nameLabel)
    {
        UIView *superView = self;
        _nameLabel = [[UILabel alloc]init];
        [superView addSubview:_nameLabel];
        [_nameLabel setFont:fontCommonSize];
        [_nameLabel setTextColor:rgba(136,159,208,1)];
    }
    return _nameLabel;
}

- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(superView.mas_left);
        make.height.width.mas_equalTo(px1920Height(45));
    }];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(_iconImageView.mas_right).with.offset(px1080Width(28));
        make.right.mas_equalTo(superView.mas_right);
    }];
}

@end
